from_hex

pure static function from_hex(value: text): byte_array

Create a byte array from a hexadecimal string.

The given hexadecimal string must have even length, since two hexadecimal characters encode one byte.

Since

0.9.0

Parameters

value

the hexadecimal string

Throws

exception

if value has odd length or contains invalid characters